import java.util.LinkedHashMap;

public class Test {
    public static void main(String[] args) {

        Student student1 = new Student("01","老A");
        Student student2 = new Student("02","老S");
        Student student3 = new Student("03","老D");
        Student student4 = new Student("04","老E");
        Student student5 = new Student("05","老W");
        Student student6 = new Student("06","老Q");


        LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap<>();

        linkedHashMap.put(student1.getId(),student1.getName());
        linkedHashMap.put(student2.getId(),student2.getName());
        linkedHashMap.put(student3.getId(),student3.getName());
        linkedHashMap.put(student4.getId(),student4.getName());
        linkedHashMap.put(student5.getId(),student5.getName());
        linkedHashMap.put(student6.getId(),student6.getName());

        System.out.println("获取学号01的学生名字:" + linkedHashMap.get("01"));
        System.out.println("获取学号03的学生名字:" + linkedHashMap.get("03"));
        System.out.println("获取学号06的学生名字:" + linkedHashMap.get("06"));

        System.out.print("所有学生的信息: ");
        linkedHashMap.forEach(
                (name,Id) -> System.out.print(name + ":" + Id + " ")
        );
    }
}
